package com.daniel.cms.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 详细说明
 *
 * @author Daniel
 * @version V1.0
 * @date 2020/5/29 16:49
 */
@Data
@Accessors(chain = true)
public class BaseEntity implements Serializable {
	/**
	 * 主键
	 */
	@TableId(type = IdType.UUID)
	private String id;

	/**
	 * 乐观锁
	 */
	@JsonIgnore
	@Version
	private Integer version;
	/**
	 * 逻辑删除
	 */
	@JsonIgnore
	@TableLogic
	private Integer deleted;
	/**
	 * 创建时间
	 */
	@JsonIgnore
	@TableField(fill = FieldFill.INSERT)
	private Date gmtCreate;
	/**
	 * 更新时间
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private Date gmtModified;
}
